import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import eslintPlugin from 'vite-plugin-eslint'
const path = require('path')
export default defineConfig({
  plugins: [vue(), vueJsx(), eslintPlugin({})],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  // base:loadEnv(mode, process.cwd()).VITE_APP_NAME//// 打包路径
  base: '/blog-front/',
  server: {
    port: 4000, // 服务端口号
    open: true, // 服务启动时是否自动打开浏览器
    cors: true, // 允许跨域,
    proxy: {
      '/api': 'https://service-42nlxh0i-1301583626.gz.apigw.tencentcs.com/'
    }
  },
  define: {
    'process.env': {
      VUE_APP_BASE_API: 'https://service-42nlxh0i-1301583626.gz.apigw.tencentcs.com/api'
    }
  }
})
